﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Cms/Admin.Master" AutoEventWireup="true"
    CodeBehind="ReplyGuest.aspx.cs" Inherits="Aij1.Cms.ReplyGuest" %>

<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Xpo.v13.1.Web, Version=13.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Xpo" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
            margin-bottom: 1em;
        }
        .value
        {
            font-weight: bold;
        }
        .cnt
        {
            height: 4em;
            background: #fcfcfc;
        }
    </style>
    <script type="text/javascript">
        function reply(oid) {
            grid.StartEditRowByKey(oid);
        }
        function del(oid) {
            if (confirm("确认删除?")) {
                grid.DeleteRowByKey(oid);
            }
        }
    </script>
</asp:Content>
<asp:Content ID="CT2" ContentPlaceHolderID="PH" runat="server">
    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" ClientInstanceName="grid"
        DataSourceID="XpoDataSource1" KeyFieldName="Oid" Width="800px" 
        onrowupdating="ASPxGridView1_RowUpdating">
        <Columns>
            <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn Caption="编号" FieldName="Oid" ReadOnly="True" VisibleIndex="1">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="客户名" FieldName="GuestName" VisibleIndex="2">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="电话" FieldName="Tel" VisibleIndex="3">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="QQ" VisibleIndex="4">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="内容" FieldName="Content" VisibleIndex="5">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataDateColumn Caption="留言时间" FieldName="WriteTime" VisibleIndex="6">
            </dx:GridViewDataDateColumn>
            <dx:GridViewDataTextColumn Caption="回复" FieldName="Reply" VisibleIndex="7">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="回复人" FieldName="Replyer" VisibleIndex="8">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataDateColumn Caption="回复时间" FieldName="ReplyTime" VisibleIndex="9">
            </dx:GridViewDataDateColumn>
            <dx:GridViewCommandColumn Caption="操作" VisibleIndex="10">
                <EditButton Text="回复" Visible="True">
                </EditButton>
                <DeleteButton Text="删除" Visible="True">
                </DeleteButton>
                <CancelButton Text="取消" Visible="True">
                </CancelButton>
                <UpdateButton Text="确认回复" Visible="True">
                </UpdateButton>
                <ClearFilterButton Visible="True">
                </ClearFilterButton>
            </dx:GridViewCommandColumn>
        </Columns>
        <Templates>
            <DataRow>
                <table class="style1" border="1" style="border-collapse: collapse;">
                    <tr>
                        <td width="60">
                            客户名:
                        </td>
                        <td width="120" class="value">
                            <%#Eval("GuestName") %>
                        </td>
                        <td width="180">
                            电话:<%#Eval("Tel") %></td>
                        <td width="180">
                            QQ:<%#Eval("QQ") %></td>
                        <td>
                            留言时间:<%#Eval("WriteTime", "{0:yyyy-MM-dd HH:mm}") %></td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr class="cnt">
                        <td>
                            留言:
                        </td>
                        <td colspan="4" valign="top">
                            <%#CommOp.ToHtmlStr(Eval("Content")) %>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            回复人
                        </td>
                        <td>
                            <%#Eval("Replyer") %>
                        </td>
                        <td colspan="3">
                            回复时间:
                            <%#Eval("ReplyTime", "{0:yyyy-MM-dd HH:mm}") %>
                        </td>
                        <td rowspan="2" align="center">
                            <a href='javascript:reply(<%#Eval("Oid") %>)'>回复</a>
                            <br />
                            <a href='javascript:del(<%#Eval("Oid") %>)'>删除</a>
                        </td>
                    </tr>
                    <tr class="cnt">
                        <td>
                            回复:
                        </td>
                        <td colspan="4" valign="top">
                            <%#CommOp.ToHtmlStr(Eval("Reply")) %>
                        </td>
                    </tr>
                </table>
            </DataRow>
            <EditForm>
                <table class="style1" border="1" style="border-collapse: collapse;">
                    <tr>
                        <td width="60">
                            回复人:
                        </td>
                        <td width="120">
                            <dx:ASPxTextBox ID="txtReplyer" Text='<%#Bind("Replyer") %>' runat="server" Width="120px">
                            </dx:ASPxTextBox>
                        </td>
                        <td align="right">
                            回复时间:
                        </td>
                        <td width="130">
                            <dx:ASPxTextBox ID="txtReplyTime" runat="server" Text='<%#Bind("ReplyTime", "{0:yyyy-MM-dd HH:mm}") %>'
                                Width="130px">
                            </dx:ASPxTextBox>
                        </td>
                        <td rowspan="2" align="center">
                            <dx:ASPxGridViewTemplateReplacement ID="UpdateButton" ReplacementType="EditFormUpdateButton"
                                runat="server"></dx:ASPxGridViewTemplateReplacement>
                            <br />
                            <dx:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton"
                                runat="server"></dx:ASPxGridViewTemplateReplacement>
                        </td>
                    </tr>
                    <tr class="cnt">
                        <td>
                            回复:
                        </td>
                        <td colspan="3">
                            <dx:ASPxMemo ID="txtReply" runat="server" Text='<%#Bind("Reply") %>' Rows="4" Columns="80">
                            </dx:ASPxMemo>
                        </td>
                    </tr>
                </table>
            </EditForm>
        </Templates>
    </dx:ASPxGridView>
    <dx:XpoDataSource ID="XpoDataSource1" runat="server" TypeName="Aij1.Model.G_GuestBook"
        Criteria="" DefaultSorting="WriteTime DESC">
    </dx:XpoDataSource>
</asp:Content>
